home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / music / fft4wav3.zip / C_SOURCE.ARJ / VGA&BMP.H < prev    next >
C/C++ Source or Header  |  1994-09-17  |  9KB  |  275 lines

  1. typedef struct tagBITMAPFILEHEADER
  2. {
  3.         unsigned int  bfType;                   // "BM" or 0x4D42
  4.         unsigned long bfSize;                   // Size of file in bytes
  5.         unsigned int  bfReserved1;              // Set to 0
  6.         unsigned int  bfReserved2;              // Set to 0
  7.         unsigned long bfOffBits;                // Offset in file where
  8.                                                 // the bits begin
  9. } BITMAPFILEHEADER;
  10.  
  11. typedef struct tagBITMAPINFOHEADER
  12. {
  13.         unsigned long biSize;                   // Size of the structure
  14.         unsigned long biWidth;                  // Width in pixels
  15.         unsigned long biHeight;                 // Height in pixels
  16.         unsigned int  biPlanes;                 // # of color Planes: Set to 1
  17.         unsigned int  biBitCount;               // Color bits per pixel
  18.         unsigned long biCompression;            // Compression Scheme
  19.         unsigned long biSizeImage;              // Number of bitmap bytes
  20.         unsigned long biXPelsPerMeter;          // Horizontal Resolution
  21.         unsigned long biYPelsPerMeter;          // Vertical Resolution
  22.         unsigned long biClrUsed;                // Number of colors used
  23.         unsigned long biClrImportant;           // Important colors
  24.  
  25. } BITMAPINFOHEADER;
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. #include <dos.h>
  34.  
  35. #ifndef _DAC16_
  36. #define _DAC16_
  37. typedef unsigned char DacPalette16[16][3];
  38. #endif
  39.  
  40. extern int far Svga16_fdriver[];
  41.  
  42. /* These are the currently supported modes */
  43. #ifndef SVGA320x200x16
  44. #define SVGA320x200x16    0    /* 320x200x16 Standard EGA/VGA */
  45. #define SVGA640x200x16    1    /* 640x200x16 Standard EGA/VGA */
  46. #define SVGA640x350x16    2    /* 640x350x16 Standard EGA/VGA */
  47. #define SVGA640x480x16    3    /* 640x480x16 Standard VGA */
  48. #define SVGA800x600x16    4    /* 800x600x16 SuperVGA/VESA */
  49. #define SVGA1024x768x16    5    /* 1024x768x16 SuperVGA/VESA */
  50. #endif
  51.  
  52. #ifndef XNOR_PUT
  53. #define    XNOR_PUT    5
  54. #define NOR_PUT        6
  55. #define NAND_PUT    7
  56. #define TRANS_COPY_PUT    8    /* Doesn't work with 16-color drivers */
  57. #endif
  58.  
  59.  
  60. #ifndef __MOUSE_H
  61. #define __MOUSE_H
  62.  
  63.  
  64. /****************************************************************************
  65.  
  66.  Include files
  67.  
  68. ****************************************************************************/
  69.  
  70. #include <dos.h>
  71. #include <alloc.h>
  72.  
  73.  
  74. /****************************************************************************
  75.  
  76.  Defines, bit masks and flags
  77.  
  78. ****************************************************************************/
  79.  
  80. #define MOUSE_INTR    0x33    /* interrupt number for MS mouse driver    */
  81.  
  82. /* Bit masks for button state */
  83.  
  84. #define S_LEFT_BUTTON    1    /* bit 0 = left button status              */
  85. #define S_RIGHT_BUTTON    2    /* bit 1 = right button status             */
  86. #define S_MIDDLE_BUTTON    4    /* bit 2 = middle button status            */
  87. #define S_ALL_BUTTONS    7
  88.  
  89. /* Button IDs for check_down and check_up */
  90.  
  91. #define LEFT_BUTTON        0
  92. #define RIGHT_BUTTON        1
  93. #define MIDDLE_BUTTON        2
  94.  
  95. /* Bit masks for Get/SetMouseHandler */
  96.  
  97. #define H_MOVED        1
  98. #define H_LEFT_DOWN    2
  99. #define H_LEFT_UP    4
  100. #define H_RIGHT_DOWN    8
  101. #define H_RIGHT_UP    16
  102. #define H_MIDDLE_DOWN    32
  103. #define H_MIDDLE_UP    64
  104.  
  105. /* Bit masks for Get/SetAlternateMouseHandler */
  106.  
  107. #define A_MOVED        128
  108. #define A_LEFT_DOWN    64
  109. #define A_LEFT_UP    32
  110. #define A_RIGHT_DOWN    16
  111. #define A_RIGHT_UP    8
  112. #define A_SHIFT        4
  113. #define A_CTRL        2
  114. #define A_ALT        1
  115.  
  116.  
  117. /****************************************************************************
  118.  
  119.  Typedefs and related info
  120.  
  121. ****************************************************************************/
  122.  
  123. typedef struct
  124. {
  125.   char HotX;        /* X value of hotspot                    */
  126.   char HotY;        /* Y value of hotspot                    */
  127.   int ScreenMask[16];    /* screen mask (int per line, LSB right) */
  128.   int CursorMask[16];    /* cursor mask (same)                    */
  129. } MouseCursor;
  130.  
  131. typedef struct
  132. {
  133.   char Width;        /* width (in words) of the masks       */
  134.   char Height;        /* height of masks                     */
  135.   char HotX;        /* hotspot X value                     */
  136.   char HotY;        /* hotspot Y value                     */
  137.   void far* Data;    /* pointer to screen and cursor masks  */
  138. } LargeMouseCursor;
  139.  
  140. typedef void far (*MouseHandler)();
  141.  
  142. /*
  143.  
  144. Structure for large cursor data
  145.  
  146. 0    char Width;    width (in words) of the masks
  147. 1    char Height;    height of the masks
  148. 2    char HotX;    hotspot X value
  149. 3    char HotY;    hotspot Y value
  150. 4    void far* Data;    far pointer to data of the following form:
  151.  
  152. Data    int ScreenMask    screen mask (can this be in color?)
  153.      [Width*Height];
  154.  
  155.     int CursorMask    cursor mask (same) (masks must be contiguous)
  156.      [Width*Height];
  157. */
  158.  
  159.  
  160. /****************************************************************************
  161.  
  162.  External variables
  163.  
  164. ****************************************************************************/
  165.  
  166. extern int
  167.      DriverPresent;        /* not present until initialized           */
  168. extern int
  169.      NumberOfButtons;    /* number of buttons mouse has             */
  170. extern int
  171.      MouseX;        /* x position of mouse                     */
  172. extern int
  173.      MouseY;        /* y position of mouse                     */
  174. extern int
  175.      MouseButton;        /* button state of mouse                   */
  176. extern int
  177.      WhichButton;        /* which button the down/up info refers to */
  178. extern int
  179.      MousePressed;        /* number of presses since last call       */
  180. extern int
  181.      MouseWhereX;        /* x where pressed                         */
  182. extern int
  183.      MouseWhereY;        /* y where pressed                         */
  184. extern int
  185.      MouseMovedX;        /* x since last move                       */
  186. extern int
  187.      MouseMovedY;        /* y since last move                       */
  188. extern MouseHandler
  189.      LastMouseHandler;    /* result of GetMouseHandler           */
  190. extern int
  191.      MouseXSpeed;        /* horizontal mouse speed setting       */
  192. extern int
  193.      MouseYSpeed;        /* vertical mouse speed setting           */
  194. extern int
  195.      MouseDoubleThreshold;    /* double speed threshold setting       */
  196.  
  197.  
  198. /****************************************************************************
  199.  
  200.  Function prototypes
  201.  
  202. ****************************************************************************/
  203.  
  204. extern int
  205.      InitMouseDriver(void);            /* initialize mouse driver */
  206. extern void
  207.      ShowMouseCursor(void);                 /* show mouse cursor       */
  208. extern void                                     
  209.      HideMouseCursor(void);                 /* hide mouse cursor       */
  210. extern int
  211.      GetMouseStatus(void);                  /* get mouse status        */
  212. extern void
  213.      SetMousePosition(int x, int y);        /* set mouse position      */
  214. extern int
  215.      GetMouseDown(int b);                   /* check button press      */
  216. extern int
  217.      GetMouseUp(int b);                     /* check button release    */
  218. extern void
  219.      SetMouseXRange(int l, int h);          /* set horizontal range    */
  220. extern void
  221.      SetMouseYRange(int l, int h);          /* set vertical range      */
  222. extern void
  223.      SetMouseCursor(MouseCursor mc);        /* set mouse cursor        */
  224. extern int
  225.      GetMouseMove(void);                    /* check mouse movement    */
  226. extern void
  227.      SetMouseHandler
  228.        (MouseHandler mh, int mask);        /* set mouse handler       */
  229. extern void
  230.      SetLightPenEmulation(int flag);        /* set light pen emulation */
  231. extern void
  232.      SetMickeyRatio(int x,int y);           /* set "mickey" ratio      */
  233. extern void
  234.      SetUpdateRegion
  235.        (int x0, int y0, int x1, int y1);    /* set update region       */
  236. extern int
  237.      SetLargeMouseCursor
  238.        (LargeMouseCursor mc);               /* set large mouse cursor  */
  239. extern void
  240.      ExchangeMouseHandler
  241.        (MouseHandler mh, int mask);         /* exchange mouse handler  */
  242. extern int
  243.      GetDriverStateSize(void);              /* get driver state size   */
  244. extern void far*
  245.      GetDriverState(void);                  /* get driver state        */
  246. extern void
  247.      SetDriverState(void far* fp);        /* set driver state        */
  248. extern int
  249.      SetAltMouseHandler
  250.        (MouseHandler mh, int mask);         /* set handler, alternate  */
  251. extern MouseHandler
  252.      GetAltMouseHandler(int mask);          /* get handler, alternate  */
  253. extern void
  254.      SetMouseSensitivity
  255.        (int xs, int ys, int dt);            /* set mouse sensitivity   */
  256. extern void
  257.      GetMouseSensitivity(void);             /* get mouse sensitivity   */
  258. extern void
  259.      SetMouseDisplayPage(int page);         /* set display page        */
  260. extern int
  261.      GetMouseDisplayPage(void);             /* get display page        */
  262. extern int
  263.      DisableMouseDriver(void);              /* disable mouse driver    */
  264. extern int
  265.      EnableMouseDriver(void);               /* enable mouse driver     */
  266. extern int
  267.      ResetMouse(void);                      /* reset mouse             */
  268. extern int
  269.      StartMouse(void);            /* start using mouse       */
  270. extern void
  271.      EndMouse(void);            /* stop using mouse        */
  272.  
  273.  
  274. #endif
  275.